/**
 * @file   main.cpp
 * @author xingyifan <xingyifan@xingyifan-VirtualBox>
 * @date   Wed Nov  4 13:55:40 2020
 * 
 * @brief  main
 * 
 * 
 */

#include "Binary_Tree.h"
#include <chrono>

int main(int argc, char * argv[]) {
    int n;
    double x;
    std::cin >> n;    
    Binary_Tree<double> A;

    typedef std::chrono::high_resolution_clock myclock;
    //start the timer
    myclock::time_point beginning = myclock::now();    
    for (int i=0;i<n;i++) {
	std::cin >> x;
	A.insert(x);
    }

    /*   
    std::cout << "The max: " << A.max() << std::endl;
    std::cout << "The min: " << A.min() << std::endl;
    A.search(0.5);
    A.test_successor(1);
    A.test_predeccessor(1);
    A.print();
    
    for (int i=0;i<n;i++) {
	A.inorder_walk();
	x = A.max();
	A.Delete(x);
	std::cout << std::endl;
    }
    */
    A.inorder_walk();
    std::cout << std::endl;
    //finish the timer
    myclock::duration d = myclock::now() - beginning;
    std::cout << "time: " << d.count() << std::endl;
   
    return 0;
}
